<template>
  <my-swiper class="miste-swiper" :pagination="true" :play="false" @handleSwiperBtn="handleSwiperBtn">
    <swiper-slide class="swiper-slide" slot="swiper-slide">
      <div
        v-for="(item, index) in arr[0]"
        class="food"
        :key="index"
        :data-title="item.title"
      >
        <img :src="`https://fuss10.elemecdn.com/${item.image_url}`" alt="" :data-title="item.title" />
        <span :data-title="item.title">
          {{ item.title }}
        </span>
      </div>
    </swiper-slide>
    <swiper-slide class="swiper-slide" slot="swiper-slide">
      <div
        v-for="(item, index) in arr[1]"
        class="food"
        :key="index"
         :data-title="item.title"
      >
        <img :src="`https://fuss10.elemecdn.com/${item.image_url}`" alt="" :data-title="item.title" />
        <span :data-title="item.title">
          {{ item.title }}
        </span>
      </div>
    </swiper-slide>
  </my-swiper>
</template>

<script>
import { SwiperSlide } from "vue-awesome-swiper";
import MySwiper from "components/common/swiper/MySwiper";
export default {
  props: {
    arr: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  components: {
    MySwiper,
    SwiperSlide,
  },
  mounted() {
    
  },
  methods: {
    handleSwiperBtn(path) {
      this.$emit('handleSwiperBtn', path)
    }
  },
};
</script>
<style lang="less" scoped>
.miste-swiper {
  padding: 10px 0 20px;
  text-align: center;
  margin-bottom: 15px;
  background-color: #fff;
  font-size: 12px;
  .swiper-slide {
    display: flex;
    flex-wrap: wrap;
    .food {
      width: 25%;
      img {
        width: 40px;
      }
      span {
        display: block;
        margin: 10px 0;
      }
    }
  }
}
</style>